<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>7.解构操作的简写形式与变量解构</title>
</head>

<body>
  <script>
    // 解构 对象
    //let web = { name: "后盾人", url: "houdunren.com" };
    //let { name, url } = web;
    //console.log(name); //后盾人
    // 解构数组
    let web = ["后盾人", "houdunren.com"];
    /* let [ a, b ] = web;
    console.log(a); //后盾人 */
    // 解构 部分 数组元素
    let [, b] = web;
    console.log(b);
    // 解构 部分 对象的变量
    let { name } = { name: '后盾人', url: 'houdunren.com' };
    console.log(name); //后盾人
  </script>
</body>

</html>